package com.financing.platform.dao.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IOrderPhoDao;
import com.financing.platform.util.SqlName;
import com.financing.platform.vo.OrderPhoVO;

@Repository
public class OrderPhoDaoImpl extends BaseDaoImpl implements IOrderPhoDao{

	@Override
	public int updateOrderPho(OrderPhoVO orderPhoVO) throws SQLException {
		return this.sqlMapClient.update(SqlName.updateOrderPho,orderPhoVO);
	}
	
	@Override
	public List<Map<String, Object>> queryOrderPho(OrderPhoVO orderPhoVO)
			throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.queryOrderPho,orderPhoVO);
	}

	@Override
	public Map<String, Object> queryOrderPhoConfirm(OrderPhoVO orderPhoVO)
			throws SQLException {
		return (Map<String, Object>) this.sqlMapClient.queryForObject(SqlName.queryOrderPhoConfirm,orderPhoVO);
	}

	@Override
	public int deleteOrderPho(OrderPhoVO orderPhoVO) throws SQLException {
		return this.sqlMapClient.delete(SqlName.deleteOrderPhoStatus,orderPhoVO);
	}

	@Override
	public int addFpOrderPho(OrderPhoVO orderPhoVO) throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.addOrderPho,orderPhoVO);
	}

	@Override
	public Map<String, Object> queryOrderTmpConfirm(OrderPhoVO orderPhoVO)
			throws SQLException {
		return (Map<String, Object>) this.sqlMapClient.queryForObject(SqlName.queryOrderTmpConfirm,orderPhoVO);
	}

	@Override
	public OrderPhoVO queryOrderPhoById(Integer id) throws SQLException {
		return (OrderPhoVO) this.sqlMapClient.queryForObject("orderPho.queryOrderPhoById",id);
	}
}
